package com.rtp2p.rtcoresdkdemo.add.lan

import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.viewModels
import com.rtp2p.rtcoresdkdemo.base.BaseFragment
import com.rtp2p.rtcoresdkdemo.databinding.AddBindingLanFragmentBinding

class AddBindingLanFragment : BaseFragment() {
    private val viewModel: AddBindingLanViewModel by viewModels()

    override fun initWorkspaceAction(inflater: LayoutInflater, container: ViewGroup?): View {
        val binding = AddBindingLanFragmentBinding.inflate(layoutInflater)
        binding.lifecycleOwner = this
        binding.vm = viewModel
        binding.btnReturn.setOnClickListener { finish() }
        return binding.root
    }

    override fun onStart() {
        super.onStart()
        viewModel.startSearch()
    }

    override fun onStop() {
        super.onStop()
        viewModel.stopSearch()
    }
}